package com.duobao.uitl;

public class SplitString 
{
    private SplitString()
    {

    }
    public static String[] splitString(String s)
    {
        int a;
        if(s.length()%34==0)
        {
            a = s.length()/34;
        }else
        {
            a = (s.length()/34)+1;
        }
        String St[] = new String[a];
        for(int i=0;i<St.length;i++)
        {
            if(i==(St.length-1))
            {
                St[i] = s.substring(34*i);
            }else
            {
                St[i] = s.substring(34*i,34*(i+1));
            }
        }
    return St;
    }
    public static String[] splitString2(String s)
    {
        String Stt[] = s.split("！");
        int b = Stt.length;
        int d=0;
        for(int l=0;l<b;l++)
        {
            d = d+SplitString.splitString(Stt[l]).length;
        }
        String St[] = new String[d];
        int ee=0;
        for(int l=0;l<b;l++)
        {
            int e=SplitString.splitString(Stt[l]).length;
            for(int k=0;k<e;k++)
            {
                St[k+ee]= SplitString.splitString(Stt[l])[k];
            }
            ee=ee+e;
        }

    return St;
    }
    public static String[] splitString3(String[] s)
    {
        String Stt[] = s;
        int b = Stt.length;
        int d=0;
        for(int l=0;l<b;l++)
        {
            d = d+SplitString.splitString(Stt[l]).length;
        }
        String St[] = new String[d];
        int ee=0;
        for(int l=0;l<b;l++)
        {
            int e=SplitString.splitString(Stt[l]).length;
            for(int k=0;k<e;k++)
            {
                St[k+ee]= SplitString.splitString(Stt[l])[k];
            }
            ee=ee+e;
        }

    return St;
    }
    public static String[] splitNPCName(String s)
    {
        int a=s.length();
        String St[]=null;
        if(a<=30)
        {
            St = new String[]{s};
        }else if(a<=64){
            St = new String[]{s.substring(0,30),s.substring(30,s.length())};
        }else if(a<=98)
        {
            St = new String[]{s.substring(0,30),s.substring(30,64),s.substring(64,s.length())};
        }
        return St;
    }
    public static String[] splitEquipName(String s)
    {
        int a=s.length();
        String St[]=null;
        if(a<=31)
        {
            St = new String[]{s};
        }else if(a<=65){
            St = new String[]{s.substring(0,31),s.substring(31,s.length())};
        }else if(a<=99)
        {
            St = new String[]{s.substring(0,31),s.substring(31,65),s.substring(64,s.length())};
        }
        return St;
    }
}
